package com.black.utils.network.transmit.udp;

import com.black.utils.commons.pool.PoolFactory;
import com.black.utils.commons.pool.PoolProperties;

/**
 * @author ylx
 */
public class UDPClientFactory extends PoolFactory<UDPClient> {
    public UDPClientFactory(PoolProperties poolProperties) {
        super(poolProperties);
    }

    @Override
    public UDPClient make() throws Exception {
        return new UDPClient(poolProperties);
    }

    @Override
    public void destroy(UDPClient udpClient) throws Exception {
        if (udpClient != null) {
            udpClient.close();
        }
    }

    @Override
    public boolean validate(UDPClient udpClient) throws Exception {
        return true;
    }

    @Override
    public void active(UDPClient udpClient) throws Exception {

    }

    @Override
    public void passivate(UDPClient udpClient) throws Exception {

    }
}
